//
// Created by 吴喆 on 2020/3/2.
//

#ifndef SUMMER_LOCK_H
#define SUMMER_LOCK_H

#include <mutex>

#define synchronized(mutex) for(int _i=0; _i<1; _i++)for(Lock lock(mutex); _i<1; _i++)

class Lock {
public:
    explicit Lock(std::mutex &&mutex) : mutex(mutex) {
        this->mutex.lock();
    };

    ~Lock() {
        mutex.unlock();

    }

private:
    std::mutex &mutex;

};


#endif //SUMMER_LOCK_H
